<%@ Page Language="VB" MasterPageFile="~/Template.master" AutoEventWireup="false"
    CodeFile="Register.aspx.vb" Inherits="Register" Title="Register" %>

<%@ Register Src="~/Controls/UserProfile.ascx" TagName="UserProfile" TagPrefix="mb" %>

<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="Server">
    <asp:CreateUserWizard runat="server" ID="CreateUserWizard1" AutoGeneratePassword="False" 
        ContinueDestinationPageUrl="~/Default.aspx" FinishDestinationPageUrl="~/Default.aspx" >
        <WizardSteps>
            <asp:CreateUserWizardStep runat="server">
                <ContentTemplate>
                    <div class="sectionTitle">
                        Create your new account</div>
                    <p>
                    </p>
                    <table cellspacing="2">
                        <tr>
                            <td width="120" class="fieldname">UserName:</td>
                            <td width="300">
                                <asp:TextBox runat="server" ID="UserName" Width="100%" />
                            </td>
                            <td>
                                <asp:RequiredFieldValidator ID="valRequireUserName" runat="server" ControlToValidate="UserName"
                                    SetFocusOnError="true" Display="Dynamic" ErrorMessage="Username is required."
                                    ValidationGroup="CreateUserWizard1">*
                                </asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td class="fieldname">Password:</td>
                            <td>
                                <asp:TextBox runat="server" ID="Password" TextMode="Password" Width="100%" />
                            </td>
                            <td>
                                <asp:RequiredFieldValidator ID="valRequirePassword" runat="server" ControlToValidate="Password"
                                    SetFocusOnError="true" Display="Dynamic" ErrorMessage="Password is required."
                                    ValidationGroup="CreateUserWizard1">*
                                </asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="valPasswordLength" runat="Server" ControlToValidate="Password"
                                    SetFocusOnError="True" Display="Dynamic" ValidationExpression="\w{3}" ErrorMessage="Password must be 3 characters long."
                                    ValidationGroup="CreateUserWizard1">*
                                </asp:RegularExpressionValidator>
                            </td>
                        </tr>
                        <tr>
                            <td class="fieldname">Confirm password:</td>
                            <td>
                                <asp:TextBox runat="server" ID="ConfirmPassword" TextMode="Password" Width="100%" />
                            </td>
                            <td>
                                <asp:RequiredFieldValidator ID="valRequireConfirmPassword" runat="server" ControlToValidate="ConfirmPassword"
                                    SetFocusOnError="true" Display="Dynamic" ErrorMessage="Confirm Password is required."
                                    ValidationGroup="CreateUserWizard1">*
                                </asp:RequiredFieldValidator>
                                <asp:CompareValidator ID="valComparePasswords" runat="server" ControlToCompare="Password" SetFocusOnError="true" 
                                ControlToValidate="ConfirmPassword" Display="Dynamic" 
                                ErrorMessage="Password and Confirmation Password must match." ValidationGroup="CreateUserWizard1">*
                                </asp:CompareValidator>
                            </td>
                        </tr>
                         <tr>
                            <td class="fieldname">E-mail:</td>
                            <td>
                                <asp:TextBox runat="server" ID="Email" Width="100%" />
                            </td>
                            <td>
                                <asp:RequiredFieldValidator ID="valRequireEmail" runat="server" ControlToValidate="Email"
                                    SetFocusOnError="true" Display="Dynamic" ErrorMessage="E-mail is required."
                                    ValidationGroup="CreateUserWizard1">*
                                </asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="valEmailPattern" runat="Server" ControlToValidate="Email"
                                    SetFocusOnError="True" Display="Dynamic" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" 
                                    ErrorMessage="The E-mail address is not formatted correctly."
                                    ValidationGroup="CreateUserWizard1">*
                                </asp:RegularExpressionValidator>
                            </td>
                        </tr>
                         <tr>
                            <td class="fieldname">Security question:</td>
                            <td>
                                <asp:TextBox runat="server" ID="Question" Width="100%" />
                            </td>
                            <td>
                                <asp:RequiredFieldValidator ID="valRequireQuestion" runat="server" ControlToValidate="Question"
                                    SetFocusOnError="true" Display="Dynamic" ErrorMessage="Security question is required."
                                    ValidationGroup="CreateUserWizard1">*
                                </asp:RequiredFieldValidator>
                            </td>
                        </tr>
                         <tr>
                            <td class="fieldname">Security answer:</td>
                            <td>
                                <asp:TextBox runat="server" ID="Answer" Width="100%" />
                            </td>
                            <td>
                                <asp:RequiredFieldValidator ID="valRequireAnswer" runat="server" ControlToValidate="Answer"
                                    SetFocusOnError="true" Display="Dynamic" ErrorMessage="Security answer is required."
                                    ValidationGroup="CreateUserWizard1">*
                                </asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3" align="right">
                                <asp:Label ID="ErrorMessage" SkinID="FeedbackKO" runat="server"
                                EnableViewState="false"></asp:Label>
                            </td>
                        </tr>
                    </table>
                    <asp:ValidationSummary ValidationGroup="CreateUserWizard1" ID="ValidationSummary1" runat="server" 
                    ShowMessageBox="true" ShowSummary="false" />
                </ContentTemplate>
            </asp:CreateUserWizardStep>
            <asp:WizardStep runat="server" Title="Set preferences">
                <div class="sectiontitle">Set-up your user profile</div>
                <p></p>
                <mb:UserProfile ID="UserProfile1" runat="server" />
            </asp:WizardStep>
            <asp:CompleteWizardStep runat="server"></asp:CompleteWizardStep>
        </WizardSteps>
       
    </asp:CreateUserWizard>
</asp:Content>

